package cn.datawin.sms.enums;

public enum ApiStatus {
        _00000("00000", "提交/发送成功"),
        _00001("00001", "提交/发送失败"),
        _00002("00002", "处理中"),
        _10001("10001", "存在黑名单号码"),
        _10002("10002", "号码格式错误"),
        _10003("10003", "没有合适的通道"),
        _10004("10004", "通道被停用"),
        _10005("10005", "通道余额不足"),
        _10006("10006", "通道不在开放时间"),
        _10007("10007", "请核对该短信类型是否正确！"),
        _10008("10008","发送内容存在敏感词"),
        _10009("10009","发送内容未报备"),
        _10010("10010","审核未通过"),
        _10011("10011","非验证类短信"),
        _10012("10012","重新发送没有找到备用通道"),
        _10013("10013", "通道屏蔽了该号码归属地"),
        _10014("10014", "客户拓展码超过通道限制"),//运营商发送量限制
        _10015("10015", "客户发送频次限制"),
        _10016("10016", "短信签名不能为空！"),
        _10017("10017", "用户未绑定任何通道"),
        _10018("10018", "上游连接数为0"),
        _10019("10019", "回执72小时未知"),
        _10020("10020", "发送内容url存在黑名单"),
        _10021("10021", "发送内容url不在名单内，且该用户默认拦截"),
        _10022("10022", "频繁发送"),
        _20000("20000", "签名认证失败"),
        _20001("20001", "请求已过期"),
        _20002("20002", "参数格式错误"),
        _20003("20003", "客户附加参数超长"),
        _20004("20004", "号码数限制"),
        _20005("20005", "客户不存在"),
        _20006("20006", "客户被停用"),
        _20007("20007", "客户IP非法"),
        _20008("20008", "客户余额不足"),
        _20009("20009", "存在过滤关键词"),
        _20010("20010", "匹配短信内容特殊规则"),
        _20011("20011", "短信签名不合法"),
        _20012("20012", "批次不存在，请稍候再试"),
        _20013("20013", "附加参数重复提交"),
        _20014("20014", "秘钥错误"),
        _30001("30001", "编码重复"),
        _30002("30002", "模板重复"),
        _30003("30003", "签名错误"),
        _30004("30004", "重复上传模板编码"),
        _30005("30005", "重复上传模板内容"),
        _30006("30006", "模板审核通过"),
        _30007("30007", "模板审核驳回,不通过"),

        _30008("30008", "通知类套餐余量不足"),
        _30009("30009", "营销类套餐余量不足"),
        _30010("30010", "验证类套餐余量不足"),
        _30011("30011", "其他类套餐余量不足"),
        _30012("30012", "套餐余量不足"),
        _30013("30013", "授信或余量不足"),


        _40001("40001", "提交上游异常"),

        //平台认证错误
        _50000("50000", "平台认证凭据为空"),
        _50001("50001", "认证请求失败"),
        _50002("50002", "认证失败"),
        _50003("50003", "授权未知异常"),


        _99998("99998", "未知错误"),
        _99999("99999", "系统内部错误");
        /**
         * 状态码
         */
        private String status;
        /**
         * 描述
         */
        private String description;

        ApiStatus(String status, String description) {
            this.status = status;
            this.description = description;
        }

        public String getStatus() {
            return status;
        }

        public String getDescription() {
            return description;
        }

        public static ApiStatus valueOfStatus(String status) {
            for (ApiStatus apiStatus : ApiStatus.values()) {
                if (apiStatus.status.equals(status))
                    return apiStatus;
            }
            return null;
        }

        public static String getDescribe(String status) {
            for (ApiStatus apiStatus : ApiStatus.values()) {
                if (apiStatus.getStatus().equals(status)) {
                    return apiStatus.getDescription();
                }
            }
            return "";
        }
    }

